<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>过渡效果-CSS</title>
    <style media="screen">
      .expand-transition{
        transition: all 0.3s ease;
        height: 30px;
        padding: 10px;
        background-color: #eee;
        overflow: hidden;
      }
      .expand-enter, .expand-leave{
        height: 0;
        padding: 0 10px;
        opacity: 0;
      }
    </style>
  </head>
  <body>
    <div class="" id="app">
      <button type="button" name="button"  @click="showDiv">显示/隐藏</button>
      <div class="" v-if="show" transition="expand">
          Hello
      </div>
    </div>
    <script src="js/jquery-1.8.3.min.js" charset="utf-8"></script>
    <script src="js/vue.js" charset="utf-8"></script>
    <script type="text/javascript">
      var vm;
      $(function() {
        vm = new Vue({
          el:'#app',
          data:{
            show:true
          },
          methods:{
            showDiv:function(){
              if(this.show){
                this.show = false;
              }else{
                this.show =true;
              }
            }
          }
        })
      })
    </script>
  </body>
</html>
